package il.ac.tau.cg.ex5.util;

public final class Vertex
{
	public float x;
	public float y;
	public float z;
	
	public Vertex(float x, float y, float z)
	{
		this.x = x;
		this.y = y;
		this.z = z;
	}
	
	public Vertex negate()
	{
		return new Vertex(-x, -y, -z);
	}
	
	public Vertex subtract(Vertex v)
	{
		return new Vertex(x - v.x, y - v.y, z - v.z);
	}
	
	public Vertex cross(Vertex v)
	{
		return new Vertex(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.z);
	}
}
